package com.ellricky.baselib.dialog

import android.app.Activity
import android.content.Context
import android.widget.TextView
import androidx.appcompat.widget.AppCompatEditText
import com.ellricky.baselib.R
import com.ellricky.baselib.dialog.picker.EPickerUtil
import com.ellricky.baselib.entity.IdNamePickerEntity
import razerdp.basepopup.BasePopupWindow
import java.util.ArrayList

class VisitPopupWindow(context: Context): BasePopupWindow(context) {

    private var ePickerUtil: EPickerUtil? = null

    private var intentList: ArrayList<IdNamePickerEntity> = arrayListOf(
        IdNamePickerEntity("28", "待办理"),
        IdNamePickerEntity("291", "有意向(A)"),
        IdNamePickerEntity("292", "有意向(B)"),
        IdNamePickerEntity("293", "有意向(C)"),
        IdNamePickerEntity("294", "有意向(D)"),
        IdNamePickerEntity("30", "体验课"),
        IdNamePickerEntity("31", "回收站"),
        IdNamePickerEntity("32", "已完成"),
    )
    init {
        contentView = createPopupById(R.layout.dialog_visit)

        ePickerUtil = EPickerUtil(context as Activity)

        val etIntent = findViewById<AppCompatEditText>(R.id.et_intent)
        val tvCancel = findViewById<TextView>(R.id.tv_cancel)
        val tvConfirm = findViewById<TextView>(R.id.tv_confirm)

        tvCancel.setOnClickListener {
            dismiss()
        }

        tvConfirm.setOnClickListener {
            dismiss()
        }

        etIntent.setOnClickListener {
            ePickerUtil?.showIntentPicker(intentList, null) { _, t ->

            }
        }
    }
}